{template '_header'}
    <title>兑换中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <base target="_self">
    <link rel="stylesheet" href="../addons/ewei_shopv2/plugin/exchange/static/css/input.css">
<div id="couponsWrap" style="height: 100%;background-color: #cf3e4e;">
    <div class="bagWrap">
        <div>
            <img src="{php echo tomedia(urldecode($banner[0]));}" width="100%" id="pic" style="display: none">
            <!--<div style="height: 150px;width: 100%;background-color: #cf3e4e"></div>-->
            <img src="../addons/ewei_shopv2/plugin/exchange/static/img/input.jpg" width="100%">
        </div>
        <div class="firstStep">
            <span class="inputWrap" id="inputWrap">
                <label>
                    <span>兑换码：</span>
                    <em>
                        <input id="codeNumber" type="text" placeholder="请输入兑换码" required="required" value="">
                        <i class="clearMsg"></i>
                    </em>
                </label>
                </span>
            <br>
            <span class="btn-submit" style="position: absolute;z-index: 100" onclick="cli()">
                <a id="toChange" class="couponsSubmit sure">立即兑换</a>
            </span>
            <br>
            <br>
        </div>
        <div class="secondStep" style="display: none;">
            <ul class="coupons">
            </ul>
            <p class="couponintro">优惠券已放至绑定手机<em class="telNum"></em>的账户</p>
            <span class="btn-submit">
                <a id="toUse" class="couponsSubmit sure" href="">去使用</a>
            </span>
        </div>
        <div><img src="../addons/ewei_shopv2/plugin/exchange/static/img/bottom_bg.jpg" width="100%"><p class="coupons-desc" style="text-align: center">注意注意注意</p></div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#pic').show();
        var base = "{php echo mobileUrl('exchange/index');}";
        $(".btn-submit").click(function () {
            var key = $("#codeNumber").val();

            if(key.length>2){
                window.location.href =base+"&key="+key;
            }else{
                FoxUI.alert('请输入兑换码');
            }
        });
    });
</script>

<div class=""></div>
{template '_footer'}